import service from "../service"
import qs from 'qs'
export function getLogin (res) {
  return service({
    method: 'post',
    url: '/login',
    data: {
      res
    }
  })
}
export function getStudentList (params) {
  return service({
    method: 'GET',
    url: '/students',
    params
  })
}
export function delStudentList (id) {
  return service({
    method: 'DELETE',
    url: `/students/${id}`
  })
}
export function findStudentList (name) {
  return service({
    method: 'get',
    url: `/students?name=${name}`
  })
}
export function info (data) {
  data = qs.stringify(data)
  return service({
    method: 'POST',
    url: `/info`,
    data
  })
}
export function setInfo (data) {
  data = qs.stringify(data)
  return service({
    method: 'PUT',
    url: `/info`,
    data
  })
}
export function getInfo () {
  return service({
    method: 'get',
    url: `/info`
  })
}
export function delInfo (id) {
  return service({
    method: 'DELETE',
    url: `/info/${id}`
  })
}
export function getWorks (page, size) {
  return service({
    method: 'get',
    url: `/works?page=${page}&size=${size}`
  })
}
export function getDataView () {
  return service({
    method: 'get',
    url: `/dataview`
  })
}
export function getTravel () {
  return service({
    method: 'get',
    url: `/travel`
  })
}
